package com.cheng.common.utils;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author: ChengJW
 * @date: 2021/12/31 16:55
 * @version: 1.0
 * @description: springboot.run() 方法运行完成之后，执行的方法
 */
@Component
public class SuccessRunPrint implements ApplicationRunner {


    @Override
    public void run(ApplicationArguments args) throws Exception {
        String date = DateUtil.dateToStr(new Date(),CodeUtil.DATE_STRING);
        System.out.println("\n" +
                "【------------------------------------------------】" + "\n" +
                "【      _    _   _____   _      _      ______     】" + "\n" +
                "【     | |  | | |  ___| | |    | |    |  __  |    】" + "\n" +
                "【     | |  | | | |     | |    | |    | |  | |    】" + "\n" +
                "【     | |__| | | |___  | |    | |    | |  | |    】" + "\n" +
                "【     |  __  | |  ___| | |    | |    | |  | |    】" + "\n" +
                "【     | |  | | | |     | |    | |    | |  | |    】" + "\n" +
                "【     | |  | | | |___  | |__  | |__  | |__| |    】" + "\n" +
                "【     |_|  |_| |_____| |____| |____| |______|    】" + "\n" +
                "【                                                】" + "\n" +
                "【     The program has run successfully !         】" + "\n" +
                "【     Congratulations !                          】" + "\n" +
                "【                         Author:     " + CodeUtil.AUTHOR + "    】" + "\n" +
                "【                         Date:    " + date +"    】" + "\n" +
                "【                         Version:     " + CodeUtil.VERSION + "    】" + "\n" +
                "【------------------------------------------------】" + "\n" +
                "\n");
    }
}
